Skip to content

[appkit plugin] [5/x] Add chat server plugin to @databricks/appkit-agent#387

Open
hubertzub-db wants to merge 11 commits intodatabricks:mainfrom
hubertzub-db:stack/agent-plugin-p5
Open

[appkit plugin] [5/x] Add chat server plugin to @databricks/appkit-agent#387
hubertzub-db wants to merge 11 commits intodatabricks:mainfrom
hubertzub-db:stack/agent-plugin-p5

Conversation

@hubertzub-db
Copy link

@hubertzub-db hubertzub-db commented Mar 20, 2026

🥞 Stacked PR


Summary

Adds a ChatPlugin to @databricks/appkit-agent, exported from the @databricks/appkit-agent/chat subpath. The plugin provides a complete chat backend: streaming responses from agent or Databricks model serving endpoints, session management, optional PostgreSQL persistence, feedback via MLflow Traces, and stream resumption.

Adapted from app-templates/e2e-chatbot-app-next](https://github.com/databricks/app-templates/tree/main/e2e-chatbot-app-next), with @databricks/appkit as a peer dependency and a standalone auth module replacing internal imports.

Usage

import { createApp } from "@databricks/appkit";
import { agent, chat } from "@databricks/appkit-agent";
import { Pool } from "pg";

const app = createApp({
  plugins: [
    agent({ /* ... */ }),
    chat({
      pool: new Pool(),       // optional — omit for ephemeral (no history)
      autoMigrate: true,      // creates ai_chatbot schema/tables on startup
      backend: "agent",       // route chat through local agent plugin
    }),
  ],
});

Demo of the chat with persistence and tools (the UI runs from existing e2e-chatbot-app-next)

Screen.Recording.2026-03-25.at.11.04.21.mov

What's included

Move agent plugin source code into src/agent-plugin/ subfolder for
better organization when hosting multiple plugins.
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Add per-package pnpm-lock.yaml and CI/release workflows with
explicit pnpm version and cache-dependency-path.
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
@hubertzub-db hubertzub-db force-pushed the stack/agent-plugin-p5 branch from 2be31ff to 59b4915 Compare March 24, 2026 14:58
@@ -0,0 +1,299 @@
/**
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,28 @@
import type { ChatRow } from "./schema";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,52 @@
const MAX_ENTRIES = 10_000;

function setBounded<K, V>(map: Map<K, V>, key: K, value: V): void {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


export type { ChatRow, MessageRow };

export function createDb(pool: Pool) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hubertzub-db hubertzub-db force-pushed the stack/agent-plugin-p5 branch from 1d83c9e to 61bf6ac Compare March 24, 2026 15:33
@hubertzub-db hubertzub-db changed the title Add @databricks/appkit-chat-server package [appkit plugin] [5/x] Add chat server plugin to @databricks/appkit-agent Mar 24, 2026
@hubertzub-db hubertzub-db requested a review from bbqiu March 24, 2026 16:02
@hubertzub-db hubertzub-db marked this pull request as ready for review March 25, 2026 08:06
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
@hubertzub-db hubertzub-db force-pushed the stack/agent-plugin-p5 branch from 6cac4f3 to b074ca7 Compare March 25, 2026 09:24
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
@hubertzub-db hubertzub-db force-pushed the stack/agent-plugin-p5 branch from 8bccbd3 to c469eda Compare March 25, 2026 10:11
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
@hubertzub-db hubertzub-db force-pushed the stack/agent-plugin-p5 branch from c469eda to c4d0cb8 Compare March 25, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant